<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>后台管理系统</title>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>js/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>js/easyui/themes/icon.css">
<script type="text/javascript"
	src="<%=basePath%>js/easyui/jquery-1.7.1.min.js"></script>
<script type="text/javascript"
	src="<%=basePath%>js/easyui/jquery.easyui.min.js"></script>
<script src="<%=basePath%>js/easyui/easyloader.js"></script>
<script type="text/javascript" src="<%=basePath%>js/ChineseCalendar.js"></script>
<%-- <script type="text/javascript" src="<%=basePath%>js/locale/easyui-lang-zh_CN.js"></script> --%>
<style type="text/css">
a {
	text-decoration: none;
	color: black;
}

body {
	background-color: #DDD;
}
</style>
<script>
	$(function() {
		var _tabPanel = $("#main");
		freshAD();
		$(".easyui-accordion")
				.find("a[href]")
				.each(
						function() {
							$(this)
									.click(
											function() {
												var url = $(this).attr("href");
												var title = $(this).html();
												if (url !== "#" && url !== "") {
													if (!_tabPanel.tabs(
															'exists', title)) {
														_tabPanel
																.tabs(
																		'add',
																		{
																			title : title,
																			content : '<iframe src="'
																					+ url
																					+ '" style="padding:0;margin:0;border:0;width:100%;height:100%;"></iframe>',
																			closable : true
																		});
														bindfresh(title);
													} else {
														_tabPanel
																.tabs('select',
																		title);
													}
												}
											});
						});//end each
		window.document.addTab = function(url, title) {
			var _tabPanel = $("#main");
			if (!_tabPanel.tabs('exists', title)) {
				_tabPanel
						.tabs(
								'add',
								{
									title : title,
									content : '<iframe src="'
											+ url
											+ '" style="padding:0;margin:0;border:0;width:100%;height:100%;"></iframe>',
									closable : true
								});
				bindfresh(title);
			} else {
				_tabPanel.tabs('select', title);
			}
		}//end window.document.addTab

	});//end ready

	function freshAD() {
		var AdHtml = "<font style='width:200px' color='red'>现在时间："
				+ new Date().format("hh:mm:ss") + "&nbsp;&nbsp;今天："
				+ getChineseCalendar() + "</font>";
		$("#date").html(AdHtml);
		setTimeout("freshAD()", 500);
	}

	function goHome() {
		$("#main").tabs('select', "后台首页");
	}

	function wopen(url) {
		window
				.open(
						url,
						'newwindow',
						'height=800,width=1100,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')
	}

	function bindfresh(title) {
		/*双击刷新TAB选项卡*/
		$(".tabs-inner").dblclick(function() {
			var _ctab = $('#main').tabs('getTab', title);
			var html = _ctab.html();
			_ctab.html(html);
		});//end $(".tabs-inner").dblclick
	}

	function addTab(url, title) {
		var _tabPanel = $("#main");
		debugger;
		if (!_tabPanel.tabs('exists', title)) {
			_tabPanel
					.tabs(
							'add',
							{
								title : title,
								content : '<iframe src="'
										+ url
										+ '" style="padding:0;margin:0;border:0;width:100%;height:100%;"></iframe>',
								closable : true
							});
			bindfresh(title);
		} else {
			_tabPanel.tabs('select', title);
		}
	}
</script>
</head>
<body class="easyui-layout" style="text-align: left">
	<div region="north" style="height: 52px;">
		<div class="easyui-layout" style="height: 50px;">
			<div region="west" id="logo"
				style="height: 48px; width: 207px; background: #eee; padding: 0; margin: 0;">
				 <span id="date" style="height: 45px; width: 195px; padding: 0; margin: 0; border: 0;"></span>
			</div>
			<div region="center" style="height: 48px; padding: 0; margin: 0;"
				border="false">
				<a href="../" class="easyui-linkbutton" plain="true"
					icon="icon-next" target="_blank">网站首页</a> 
				<a href="#"
					class="easyui-linkbutton" plain="true" icon="icon-home"
					onclick="goHome()">后台首页</a> 
				<a href="loginout.do"
					onclick="if(!confirm('你确定退出吗？')){return false;}"
					class="easyui-linkbutton" plain="true" icon="icon-undo">退出系统</a> <br />
				<span>欢迎使用后台管理系统</span>
			</div>
		</div>
	</div>
	<div region="west" split="false" icon="icon-info" title="后台系统菜单"
		style="width: 208px;">
		<div class="easyui-accordion" border="false">
			<div title="系统管理" iconCls="icon-light" selected="true"
				style="overflow: auto; padding: 10px;">
				<ul class="easyui-tree">
					<li state="open"><span>用户管理</span>
						<ul>
							<li><span><a
									onclick="javascript:addTab('<%=basePath%>page/userManager.jsp','用户列表')">用户列表</a></span></li>
							<li><span><a href="#">权限管理</a></span></li>
						</ul></li>
					<li state="closed"><span>多道焦点</span>
						<ul>
							<li><span><a href="#">专题</a></span></li>
							<li><span><a link="#">资讯</a></span></li>
						</ul></li>
					<li state="closed"><span>星际剧场</span>
						<ul>
							<li><span><a href="#">视频管理</a></span></li>
						</ul></li>
					<li state="closed"><span>多道论坛</span>
						<ul>
							<li><span><a href="#">观点管理</a></span></li>
							<li><span><a link="#">专家管理</a></span></li>
						</ul></li>
				</ul>
			</div>
			<div title="其他管理" iconCls="icon-folder" style="padding: 10px;">
				<ul class="easyui-tree">
					<li><span><a href="#">会员管理</a></span></li>
					<li><span><a href="#">非会员管理</a></span></li>
					<li><span><a href="#">权限列表管理</a></span></li>
				</ul>
			</div>
		</div>
	</div>

	<div id="opt_info" border="false" region="center" title="后台首页">
		<div id="main" class="easyui-tabs" fit="true" border="false"
			plain="true">
			<div title="后台首页" style="padding: 10px;">
				<iframe frameborder="0" style="width: 100%; height: 100%;"
					src="<%=basePath%>images/main.png"></iframe>
			</div>
		</div>
	</div>
	<div region="south" style="text-align: center">多道星球后台管理系统（Duodao
		Star Background Manager System）</div>
</body>
</html>

